package com.telrob.bytevm.utils;

public class Define {
	
	public static final int EXIT=0x00;
	
	public static final int AX=0x10;
	public static final int BX=0x11;
	public static final int CX=0x12;
	public static final int DX=0x13;
	public static final int EX=0x14;
	public static final int SS=0x15;
	public static final int SI=0x16;
	public static final int SP=0x17;
	public static final int BP=0x18;
	public static final int DI=0x19;
	
	
	
	public static final int JMP=0x20;
	//条件跳转指令会用到cx寄存器
	public static final int JE=0x21;
	public static final int JNE=0x22;
	//大于
	public static final int JG=0x23;
	//小于等于
	public static final int JNG=0x24;
	//小于
	public static final int JL=0x25;
	//大于等于
	public static final int JNL=0x26;
	public static final int CMPRR =0x27;
	public static final int CMPRN =0x28;
	
	
	
	
	/***
	 * 调用本地方法， 如 call print
	 */
	public static final int CALLN=0x2A;
	//call ret
	public static final int CALL=0x2B;
	public static final int RET=0x2C;
	/**
	 * 寄存器数据相加，最终结果放在ax中
	 * ADDRR ax,bx
	 */
	public static final int ADDRR=0x30;
	/**
	 * 寄存器和数字相加，数据放在ax中
	 * ADDRN  ax,num
	 */
	public static final int ADDRN=0x31;
	
	public static final int SUBRR=0x32;
	public static final int SUBRN=0x33;
	
	public static final int MULRR=0x34;
	public static final int MULRN=0x35;
	
	public static final int DIVRR=0x36;
	public static final int DIVRN=0x37;
	
	public static final int MODRR=0x38;
	public static final int MODRN=0x39;
	
	/***
	 *  总共6字节 1字节操作码，1字节寄存器，4字节数字
	 * MOV AX,num
	 */
	public static final int MOVRN=0x40;
	/**
	 * MOV AX,BX
	 */
	public static final int MOVRR=0x41;
	/***
	 * 直接内存地址到寄存器 1字节
	 * MOV AX,#addr
	 */
	public static final int LOADB=0x42;
	/***
	 * 2字节
	 */
	public static final int LOADW=0x43;
	/**
	 * 4字节
	 */
	public static final int LOADD=0x44;
	
	/***
	 * 寄存器到数据保存到内存
	 * mov #addr,AX
	 */
	public static final int STOREB=0x45;
	public static final int STOREW=0x46;
	public static final int STORED=0x47;
	
	//操作堆栈中的数据（便于函数的调用）使用到bp寄存器
	//loads ax,0x09;
	public static final int LOADS=0x48;
	public static final int STORES=0x49;
	
	/***
	 * 压栈，只能使用几个寄存器
	 */
	public static final int PUSH=0x50;
	/***
	 * 出栈，只能使用几个寄存器
	 */
	public static final int POP=0x51;
}
